package com.cy.pj.sys.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SysUserRoleDao {
    /**
     * 根据角色ID删除用户角色表(sys_user_roles)的数据
     * @param roleId
     * @return
     */
    int deleteObjectsByRoleId(Integer roleId);

    int insertObjects(@Param("userId") Integer userId,
                      @Param("roleIds") Integer[] roleIds);

    List<Integer> findRoleIdsByUserId(Integer id);

    @Delete("delete from sys_user_roles where user_id=#{userId}")
    int deleteObjectsByUserId(Integer userId);
}
